package fr.babos.test.logmeister 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import logmeister.connectors.FirebugConnector;
	import logmeister.connectors.FlashConnector;
	import logmeister.connectors.MonsterDebuggerConnector;
	import logmeister.connectors.SosMaxConnector;
	import logmeister.connectors.TrazzleConnector;
	import logmeister.connectors.YalogConnector;
	import logmeister.LogMeister;
	
	/**
	 *
	 * LogMeister demo application.
	 * 
	 * If you want to see the stacktraces in your logging application add this to your compiler arguments:
	 * -verbose-stacktraces=true
	 *
	 * That's all! Have fun!
	 *
	 */
	
	/**
	 * ...
	 * @author Pascal Achard
	 */
	public class MyLogTest extends Sprite 
	{
		
		public function MyLogTest() 
		{
			
			
			this.addEventListener(Event.ADDED_TO_STAGE, _addedToStageHandler, false, 0, true);
			
		}
		
		private function _addedToStageHandler(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, _addedToStageHandler);
			
			var textField : TextField = new TextField();
			textField.text = "Check your logger...";
			addChild(textField);

			//var sender : String = new Error().getStackTrace();
			//trace(sender);

			
			//LogMeister.addLogger(new TrazzleConnector(stage, "Test application"));
			//LogMeister.addLogger(new SosMaxConnector());
			LogMeister.addLogger(new MonsterDebuggerConnector(stage));
			//LogMeister.addLogger(new YalogConnector());
			LogMeister.addLogger(new FlashConnector());
			
			//LogMeister.addLogger(new FirebugConnector());
			
			error('error');
			critical('critical');
			debug('debug');
			fatal('fatal');
			info('info');
			notice('notice');
			status('status');
			warn('warn');
			trace('regular trace');
			
			warn([this, 4, { tutu:54 } ]);
			
			
		}
		
		
		

	}

}